$(function(){
	$("#main_page_store").click(function(){
		location.href = "query_menber.html";
	});
	
	$("#shop_backstage").click(function(){
		location.href = "quanxian_manager.html";
	});
	
	$("#query_manager").click(function(){
		location.href = "set_permission.html";
	});
	
	$("#comment").click(function(){
		location.href = "invitation_card.html";
	});
	var $modal = $('#my-modal-loading');
	var imagePath = localStorage.getItem("query_personimage");
	console.log("头像:" + imagePath);
	$("#imagehead2").attr("src", imagePath);
	
	var query_id = localStorage.getItem("query_id");
	var person_role = localStorage.getItem("query_role");
	console.log("store_id:" + person_role);
	var urlPath = "http://yx.fxtourong.com/V1/Circle/logoutCircle" + "?store_id=" + query_id;
	if(person_role == "3"){
		$("#tui_query").css("display", "none");
	} else {
		$("#tui_query").css("display", "block");
	}
	$("#tui_query").click(function(){
		$modal.modal();
		$.ajax({
			type: "POST",
			url: urlPath,
			data: {
				token : localStorage.getItem("token")
			},
			dataType: "json",
			success: function(data) {
				$modal.modal('close');
				var code = data.code;
				console.log(code);
				if(code == "1") {
					localStorage.setItem("query_id", "");
					location.href = "queryindex.html";					
				} else {
					alert(data.message + "");
				}
			},
			error: function(e){
				$modal.modal('close');
			}
		});
	});
	
});